<?php
/**
 * Created by PhpStorm.
 * Author: 芸签cms www.yunqiancms.com
 * User: sun
 * Date: 2022/8/4
 * Time: 5:31 PM
 */
namespace app\frontend\modules\site\controllers;

use app\common\models\Theme;
use app\common\models\ThemeFile;
use app\common\services\theme\ThemeService;
use app\frontend\modules\site\services\IndexService;

class IndexController extends SiteBaseController
{
    public function index(){
        $themeService = new ThemeService();
        $themeInfo = $themeService->getDefaultThemeInfo($this->clientType,ThemeFile::TYPE_INDEX);
        $themeFileInfo = $themeInfo['themeFiles'][0];
        $view = $themeInfo['theme'].'.'.$themeFileInfo['file'];
        $res = (new IndexService())->getData($themeInfo);
        return view($view, $res);
    }
}